package com.example.demorun2.myHosptional;

import java.util.ArrayList;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadPoolTest {
    public static void main(String[] args) {
        int personSize = 10;
        ArrayBlockingQueue<Person> personList = new ArrayBlockingQueue<>(10);
        ExecutorService executorService = Executors.newCachedThreadPool();
        HospitalWindows hospitalWindows = new HospitalWindows(personSize, personList);
        for (int i = 1; i < 11; i++) {
            executorService.execute(new Person(i+"号",hospitalWindows));
        }
    }
}
